window.onload = function() {
//	var client_2 = document.getElementById("client_2");
//	var dialog_border_2 = document.getElementById("dialog_border_2");
//	client_2.onmouseover = function() {
//		dialog_border_2.style.display = "inline-block";
//	};
//	client_2.onmouseout = function() {
//		dialog_border_2.style.display = "none";
//	};
//	dialog_border_2.onmouseover = function() {
//		dialog_border_2.style.display = "inline-block";
//	};
//	dialog_border_2.onmouseout = function() {
//		dialog_border_2.style.display = "none";
//	};
}
$(document).ready(function() {
	$('[data-toggle="tooltip"]').tooltip();
});

function switchLoginType(a) {
	var hetaoCode = document.getElementById("hetaoCode")
	var hetaoAccount = document.getElementById("hetaoAccount")
	if(a.parentElement == hetaoAccount) {
		hetaoCode.style.display = "block"
		hetaoAccount.style.display = "none"
	} else if(a.parentElement == hetaoCode) {
		hetaoCode.style.display = "none"
		hetaoAccount.style.display = "block"
	}
}

function login() {
	var mobile = document.getElementById("inputCount").value
	var password = document.getElementById("inputPassword").value
	var data = {
		"mobile": mobile,
		"password": password,
	}
	$.ajax({
		type: "post",
		url: "http://localhost/zte-api/api/login",
		contentType: "application/json",
		data: JSON.stringify(data),
		success: function(r) {
			console.log(r)
			if(r.msg != "登录成功") {
				alert(r.msg)
			} else {
				$.cookie('login_cookie', r.data.token.token, {
					expires: 123456789,
					path: '/',
				})　
				console.log($.cookie("login_cookie"))
				window.location.href = "http://localhost/page/HomePage/index.html";
			}
		},
		error: function() {
			alert("error");
		}
	});
}